<%@page import="com.jfinal.kit.PropKit"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<!-- 新 Bootstrap 核心 CSS 文件 -->
		<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">

		<!-- 可选的Bootstrap主题文件（一般不用引入） -->
		<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

		<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
		<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>

		<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
		<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="http://tb1.bdstatic.com/??/tb/static-common/style/tb.js/dialog_29a9417.css,/tb/static-common/lib/tbui/style/all_1888f28.css" />
		<link rel="stylesheet" href="http://tb1.bdstatic.com/??/tb/_/index_7712603.css,/tb/_/search_2e2269a.css" />
		<link rel="stylesheet" type="text/css" href="../wx/css/default.css">
		<link rel="stylesheet" type="text/css" href="../wx/css/own.css">
		<link rel="stylesheet" href="../wx/css/body.css" />
		<title>个人信息</title>
		<style>
		body{
			font-family:"微软雅黑";
		}
		.button{
		    background: -webkit-linear-gradient(top, #25bcf6, #155891);
		    background: -o-linear-gradient(top, #fff, #0000ff);
		    border-radius: 5px;
		    width: 150px;
		    height: 26px;
		    border: 1px solid #fff;
		    color: #fff;
		    font-size: small;
		    margin-top:30px
			}
	</style>
		
		<script type="text/javascript">
		function a(){
			var carNum=$("#carNum").html();
			if(carNum==''){
				location.href="jsp/carInfo.jsp";
			}else{
				location.href="templateTest/juheQuery";
			}
		}
		</script>
	</head>

	<body>
	<div id="zhezhao" hidden>
		<div id="blank" style="width: 100%;height: 100%;opacity: 0.9;background: #000;position: absolute;z-index: 99;"> 
		
		</div>
		<div style="width: 100%;height: 100px;top:30%;position: absolute;z-index: 999;">
			<img src="../wx/images/oil.png" style="width:25px">
			<span style="padding-left: 10px;font-size: 13px;">油耗设置</span>
			<p style="color: #a5c0d5;font-size: 13px;padding-top: 30px;">您的爱车百公里油耗为<input type="tel" id="OilText" 
				style="background: none;border-bottom: 1px solid #fff;border-top:none;border-left:none;border-right:none;width:40px;padding-left: 5px;">升</p>
			<input type="button" class="button"  value="确认提交">
		</div>  
		</div>
			<!--除背景页面-->
			<div id="Content ">
				<!--上边-->
				<div class="top">
					<div class="top-left" onclick="javascript:location.href='person/getPaihang'">
						<img src="../wx/images/paihang.png" style="width:15px;margin-top: -2;">
						<span>我的排行</span>
					</div>
					<div class="top-right" onclick="javascript:location.href='person/getWeekRang'">
						<img src="../wx/images/history.png" style="width:15px">
						<span >驾驶记录</span>
					</div>
					<div class="banner" >
						<img src="${weixinUser.headImgurl}" onclick="javascript:location.href='person/edit'">
						<p>${weixinUser.nickName}</p>
					</div>
				</div>
				<!--中间-->
		<%-- 		<input type="hidden" value="${person.fen }" id="fenshu"> 
 --%>				
 				<input type="hidden" value="3" id="fenshu"> 
 				<div class="" style="position: absolute;top:27%;width:100%;color:#fff;font-family:'微软雅黑';    margin-left: -4%;">
					<div class="second circle" onclick="javascript:location.href='person/getWeekRang'">
						<!--<strong></strong>-->
						<strong style="font-size: 43px; padding-top: 48px;padding-left: 42px;font-family:'微软雅黑'"></strong>
					</div>
					<div>
						<img src="../wx/images/u-car.png" style="width: 61px;margin-top: -36%;margin-left: 10%;">
						<p id="carNum" style="margin-top: -29%;margin-left: 13%;font-size: 8px;color: #a5c0d5;height:20px;"><%-- ${person.pcarNum} --%>陕A88888</p>
					</div>
					<script src="http://libs.useso.com/js/jquery/1.11.0/jquery.min.js"></script>
					<script src="../wx/js/circle-progress.js"></script>
					<script src="../wx/js/aa.js"></script>
					<!--中下-->
					<div class="zhoujishu-centerDiv" style="" >
						<div>
							<p>
								<span class="centerbottom-span"><%-- ${person.TodayDate } --%>200</span>
								<span class="centerbottom-span-span2" >分钟</span>
							</p>
							<p class="centerDiv">耗时</p>
						</div>
						<div>
							<p>
								<span class="centerbottom-span"><%-- ${person.TodayRange } --%>200</span>
								<span class="centerbottom-span-span2">公里</span>
							</p>
							<p class="centerDiv">里程</p>
						</div>
						<div>
							<p>
								<span class="centerbottom-span"><%-- ${person.Oil} --%>20.7</span>
								<span class="centerbottom-span-span2">升<img src="../wx/images/set.png" style="width:25px;margin-top:-33px;" id="set"></span>
							</p>
							<p class="centerDiv">耗油</p>
						</div>
		    	</div>
				      <!--下-->
				      <div style="margin-top:30%">
				      	<img src="../wx/images/u-search.png" style="width:25px;margin-bottom: 5%;margin-left: 10%;"/><p></p>
				      	<input class="bottom-btn" type="button" value="违章查询" onclick="a()">
				      </div> 
				</div>
			</div>
	</body>

</html>
<script>
 			$("#blank").on('click', function(){
	           $("#Content").show();
	       	   $("#zhezhao").hide();
   			 })
		   $("#set").on('click', function(){
	           $("#Content").hide();
	       	   $("#zhezhao").show();
   			 })
		    $(".button").on('click', function(){
		    	var oil=$("#OilText").val();
		    	if(oil==''){
		    		alert("油耗不能为空");
		    		return false;
		    	}else{
		    		var regu = /^\d{1,5}(\.\d{1,3})?$/; 
					var re = new RegExp(regu);
					if(!(re.test(oil))){
						alert("请输入数字！");
						return false;
					}else{
							$.ajax({
								type : "POST",
								url : "person/setOil",
								dataType : "json",
								data : {
									oil:oil
								},
								success : function(data) {
									if(data!=null){
										var code = data["code"];
										
										if(code=="1"){
											location.href='jsp/bind.jsp';
										}else{
											//alert("设置成功");
											location.href='person/getUserInfo';
											//$("#Content").show();
									       	//$("#zhezhao").hide();
										}
									}
								},
								error : function(data) {
								}
							}); 
					}
		    		
		    		
		    	}
   			 })
	</script>